using System;
using System.Collections.Generic;
using System.Text;

namespace BadUtil
{
    /// <summary>
    /// Classs for working with hex (binary) strings.
    /// </summary>
    public static class HexString
    {
        /// <summary>
        /// Create a HexString from a byte array.
        /// </summary>
        /// <param name="bytes">The byte array to be converted.</param>
        /// <returns></returns>
        public static string FromBytes(byte[] bytes)
        {
            StringBuilder hexString = new StringBuilder(bytes.Length);

            for (int i = 0; i < bytes.Length; i++)
            {
                hexString.Append(bytes[i].ToString("X2"));
            }

            return hexString.ToString();
        }
    }
}
